import Vue from "vue";
import VueRouter from "vue-router";
import {titleControl} from "@/utils";

Vue.use(VueRouter);
import routes from "./routes"

const router = new VueRouter({
    routes,
    mode: "history"
});

router.afterEach((to, from) => {
    if(to.meta.title) {
        titleControl.setRouterTitle(to.meta.title)
    }
})

export default router;
